package com.ecoolex.discount.sales.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   折扣产品-抵用券<br>
 *<br>
 * 数据表： discount_product_vouchers
 *
 */
@Description({"折扣产品-抵用券"})
public class DiscountProductVouchers implements Serializable {
    /**
     *
     *   产品Id    <br>
     *<br>
     * 字段名： discount_product_vouchers.ProductId
     */
    @Description({"产品Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer productId;

    /**
     *
     *   价格币种    <br>
     *<br>
     * 字段名： discount_product_vouchers.CurrencyType
     */
    @Description({"价格币种", "数据长度: 10"})
    private String currencyType;

    /**
     *
     *   专柜价格    <br>
     *<br>
     * 字段名： discount_product_vouchers.CounterPrice
     */
    @Description({"专柜价格", "数据长度: 18"})
    private BigDecimal counterPrice;

    /**
     *
     *   零售价格    <br>
     *<br>
     * 字段名： discount_product_vouchers.RetailPrice
     */
    @Description({"零售价格", "数据长度: 18"})
    private BigDecimal retailPrice;

    /**
     *
     *   最大购买数量    <br>
     *<br>
     * 字段名： discount_product_vouchers.MaxBuyNumber
     */
    @Description({"最大购买数量", "数据长度: 10"})
    private Integer maxBuyNumber;

    /**
     *
     *   有效期策略; 暂无; 固定有效期; 动态有效期    <br>
     *<br>
     * 字段名： discount_product_vouchers.ExpirydateStrategy
     */
    @Description({"有效期策略; 暂无; 固定有效期; 动态有效期", "数据长度: 5"})
    private Integer expirydateStrategy;

    /**
     *
     *   有效期描述    <br>
     *<br>
     * 字段名： discount_product_vouchers.ExpirydateDescribe
     */
    @Description({"有效期描述", "数据长度: 200"})
    private String expirydateDescribe;

    /**
     *
     *   固定开始有效期    <br>
     *<br>
     * 字段名： discount_product_vouchers.FixedStartExpirydate
     */
    @Description({"固定开始有效期", "数据长度: 26"})
    private Date fixedStartExpirydate;

    /**
     *
     *   固定结束有效期    <br>
     *<br>
     * 字段名： discount_product_vouchers.FixedEndExpirydate
     */
    @Description({"固定结束有效期", "数据长度: 26"})
    private Date fixedEndExpirydate;

    /**
     *
     *   动态有效期类型; 年; 月; 日; 小时;    <br>
     *<br>
     * 字段名： discount_product_vouchers.DynamicExpirydateType
     */
    @Description({"动态有效期类型; 年; 月; 日; 小时;", "数据长度: 5"})
    private Integer dynamicExpirydateType;

    /**
     *
     *   动态有效期时间    <br>
     *<br>
     * 字段名： discount_product_vouchers.DynamicExpirydateValue
     */
    @Description({"动态有效期时间", "数据长度: 10"})
    private Integer dynamicExpirydateValue;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： discount_product_vouchers.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： discount_product_vouchers.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： discount_product_vouchers.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： discount_product_vouchers.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： discount_product_vouchers.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   产品Id    <br>
     *<br>
     * 字段名： discount_product_vouchers.ProductId
     */
    public Integer getProductId() {
        return productId;
    }

    /**
     * 设置参数<br><br>
     *
     *   产品Id<br>
     *<br>
     * 字段名： discount_product_vouchers.ProductId
     */
    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    /**
     * 获取参数<br><br>
     *
     *   价格币种    <br>
     *<br>
     * 字段名： discount_product_vouchers.CurrencyType
     */
    public String getCurrencyType() {
        return currencyType;
    }

    /**
     * 设置参数<br><br>
     *
     *   价格币种<br>
     *<br>
     * 字段名： discount_product_vouchers.CurrencyType
     */
    public void setCurrencyType(String currencyType) {
        this.currencyType = currencyType == null ? null : currencyType.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   专柜价格    <br>
     *<br>
     * 字段名： discount_product_vouchers.CounterPrice
     */
    public BigDecimal getCounterPrice() {
        return counterPrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   专柜价格<br>
     *<br>
     * 字段名： discount_product_vouchers.CounterPrice
     */
    public void setCounterPrice(BigDecimal counterPrice) {
        this.counterPrice = counterPrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   零售价格    <br>
     *<br>
     * 字段名： discount_product_vouchers.RetailPrice
     */
    public BigDecimal getRetailPrice() {
        return retailPrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   零售价格<br>
     *<br>
     * 字段名： discount_product_vouchers.RetailPrice
     */
    public void setRetailPrice(BigDecimal retailPrice) {
        this.retailPrice = retailPrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   最大购买数量    <br>
     *<br>
     * 字段名： discount_product_vouchers.MaxBuyNumber
     */
    public Integer getMaxBuyNumber() {
        return maxBuyNumber;
    }

    /**
     * 设置参数<br><br>
     *
     *   最大购买数量<br>
     *<br>
     * 字段名： discount_product_vouchers.MaxBuyNumber
     */
    public void setMaxBuyNumber(Integer maxBuyNumber) {
        this.maxBuyNumber = maxBuyNumber;
    }

    /**
     * 获取参数<br><br>
     *
     *   有效期策略; 暂无; 固定有效期; 动态有效期    <br>
     *<br>
     * 字段名： discount_product_vouchers.ExpirydateStrategy
     */
    public Integer getExpirydateStrategy() {
        return expirydateStrategy;
    }

    /**
     * 设置参数<br><br>
     *
     *   有效期策略; 暂无; 固定有效期; 动态有效期<br>
     *<br>
     * 字段名： discount_product_vouchers.ExpirydateStrategy
     */
    public void setExpirydateStrategy(Integer expirydateStrategy) {
        this.expirydateStrategy = expirydateStrategy;
    }

    /**
     * 获取参数<br><br>
     *
     *   有效期描述    <br>
     *<br>
     * 字段名： discount_product_vouchers.ExpirydateDescribe
     */
    public String getExpirydateDescribe() {
        return expirydateDescribe;
    }

    /**
     * 设置参数<br><br>
     *
     *   有效期描述<br>
     *<br>
     * 字段名： discount_product_vouchers.ExpirydateDescribe
     */
    public void setExpirydateDescribe(String expirydateDescribe) {
        this.expirydateDescribe = expirydateDescribe == null ? null : expirydateDescribe.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   固定开始有效期    <br>
     *<br>
     * 字段名： discount_product_vouchers.FixedStartExpirydate
     */
    public Date getFixedStartExpirydate() {
        return fixedStartExpirydate;
    }

    /**
     * 设置参数<br><br>
     *
     *   固定开始有效期<br>
     *<br>
     * 字段名： discount_product_vouchers.FixedStartExpirydate
     */
    public void setFixedStartExpirydate(Date fixedStartExpirydate) {
        this.fixedStartExpirydate = fixedStartExpirydate;
    }

    /**
     * 获取参数<br><br>
     *
     *   固定结束有效期    <br>
     *<br>
     * 字段名： discount_product_vouchers.FixedEndExpirydate
     */
    public Date getFixedEndExpirydate() {
        return fixedEndExpirydate;
    }

    /**
     * 设置参数<br><br>
     *
     *   固定结束有效期<br>
     *<br>
     * 字段名： discount_product_vouchers.FixedEndExpirydate
     */
    public void setFixedEndExpirydate(Date fixedEndExpirydate) {
        this.fixedEndExpirydate = fixedEndExpirydate;
    }

    /**
     * 获取参数<br><br>
     *
     *   动态有效期类型; 年; 月; 日; 小时;    <br>
     *<br>
     * 字段名： discount_product_vouchers.DynamicExpirydateType
     */
    public Integer getDynamicExpirydateType() {
        return dynamicExpirydateType;
    }

    /**
     * 设置参数<br><br>
     *
     *   动态有效期类型; 年; 月; 日; 小时;<br>
     *<br>
     * 字段名： discount_product_vouchers.DynamicExpirydateType
     */
    public void setDynamicExpirydateType(Integer dynamicExpirydateType) {
        this.dynamicExpirydateType = dynamicExpirydateType;
    }

    /**
     * 获取参数<br><br>
     *
     *   动态有效期时间    <br>
     *<br>
     * 字段名： discount_product_vouchers.DynamicExpirydateValue
     */
    public Integer getDynamicExpirydateValue() {
        return dynamicExpirydateValue;
    }

    /**
     * 设置参数<br><br>
     *
     *   动态有效期时间<br>
     *<br>
     * 字段名： discount_product_vouchers.DynamicExpirydateValue
     */
    public void setDynamicExpirydateValue(Integer dynamicExpirydateValue) {
        this.dynamicExpirydateValue = dynamicExpirydateValue;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： discount_product_vouchers.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： discount_product_vouchers.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： discount_product_vouchers.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： discount_product_vouchers.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： discount_product_vouchers.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： discount_product_vouchers.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： discount_product_vouchers.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： discount_product_vouchers.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： discount_product_vouchers.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： discount_product_vouchers.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        productId("ProductId", "productId", "INTEGER", false),
        currencyType("CurrencyType", "currencyType", "VARCHAR", false),
        counterPrice("CounterPrice", "counterPrice", "DECIMAL", false),
        retailPrice("RetailPrice", "retailPrice", "DECIMAL", false),
        maxBuyNumber("MaxBuyNumber", "maxBuyNumber", "INTEGER", false),
        expirydateStrategy("ExpirydateStrategy", "expirydateStrategy", "INTEGER", false),
        expirydateDescribe("ExpirydateDescribe", "expirydateDescribe", "VARCHAR", false),
        fixedStartExpirydate("FixedStartExpirydate", "fixedStartExpirydate", "TIMESTAMP", false),
        fixedEndExpirydate("FixedEndExpirydate", "fixedEndExpirydate", "TIMESTAMP", false),
        dynamicExpirydateType("DynamicExpirydateType", "dynamicExpirydateType", "INTEGER", false),
        dynamicExpirydateValue("DynamicExpirydateValue", "dynamicExpirydateValue", "INTEGER", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}